using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.Windows.Forms;

namespace THSERP.BaseProvider
{
    public class THSERPScreenFactory
    {
        public static THSERPScreen GetScreen(String strScreenNumber, String strModuleName)
        {
            try
            {
                //Assembly a = Assembly.GetExecutingAssembly();
                Type screenType = THSApp.THSERPAssembly.GetType(String.Format("THSERP.Modules.{0}.{1}", strModuleName, strScreenNumber));                
                return (THSERPScreen)screenType.InvokeMember("", BindingFlags.CreateInstance, null, null, null);
            }
            catch (Exception)
            {
                return new THSERPScreen();
            }

        }
    }
}
